import request from '@/utils/request'

// 获取部门列表
export async function getDeptList() {
  return request({
    url: '/dept/list',
    method: 'post',
    data: {},
  })
}
// 添加
export async function doAdd(data) {
  return request({
    url: '/dept/addDept',
    method: 'post',
    data: data,
  })
}
// 修改
export async function doEdit(data) {
  return request({
    url: '/dept/editDept',
    method: 'put',
    data: data,
  })
}
// 删除
export async function doDelete(id) {
  return request({
    url: '/dept/delDept?deptId=' + id,
    method: 'delete',
  })
}
// 查询树状结构
export async function getDeptTree() {
  return request({
    url: '/dept/getDeptTree',
    method: 'post',
    data: {},
  })
}
